package jmine.tec.persist.schema.tableperclass.identics;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.SequenceGenerator;

import jmine.tec.persist.annotation.Constraint;
import jmine.tec.persist.annotation.Index;
import jmine.tec.persist.annotation.UniqueConstraint;
import bancosys.tec.component.Documentation;
import bancosys.tec.persist.bussobj.PersistableBusinessObject;

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@SequenceGenerator(name = "SEQ_PRCLAS", sequenceName = "SEQ_PRCLAS")
public abstract class AbstractTablePerClassEntity extends PersistableBusinessObject {

    private Long id;

    private String mnemonico;

    private String campoProprio;

    /**
     * @return the campoProprio
     */
    @Column(name = "CAMPO_PROPRIO", length = 42, nullable = false)
    @Documentation("CAMPO PROPRIO PER CLASS")
    @Index(suffix = "0")
    @UniqueConstraint(suffix = "0")
    @Constraint(suffix = "0", condition = "CAMPO_PROPRIO IN ('TESTE', 'TESTECONDICAO')")
    public String getCampoProprio() {
        return this.campoProprio;
    }

    /**
     * @param campoProprio the campoProprio to set
     */
    public void setCampoProprio(String campoProprio) {
        this.campoProprio = campoProprio;
    }

    /**
     * @return the id
     */
    @Id
    @GeneratedValue(generator = "SEQ_PRCLAS")
    @Column(name = "COD_PER_CLASS", precision = 17, nullable = false)
    @Documentation("CODIGO")
    public Long getId() {
        return this.id;
    }

    /**
     * @return the mnemonico
     */
    @Column(name = "MNE", length = 20, nullable = false)
    @Documentation("MNEMONICO")
    public String getMnemonico() {
        return this.mnemonico;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param mnemonico the mnemonico to set
     */
    public void setMnemonico(String mnemonico) {
        this.mnemonico = mnemonico;
    }
}
